<template>
  <div id="app">
    <van-tabbar
      route
      active-color="#FC4141"
      inactive-color="#282828"
      v-show="isShow"
    >
      <van-tabbar-item icon="wap-home-o" to="/">书城</van-tabbar-item>
      <van-tabbar-item icon="apps-o" to="/category">分类</van-tabbar-item>
      <van-tabbar-item icon="send-gift-o" to="/bookrack">书架</van-tabbar-item>
      <van-tabbar-item icon="user-o" to="/my">我的</van-tabbar-item>
    </van-tabbar>
    <router-view />
  </div>
</template>
<script>
export default {
  data() {
    return {
      isShow: true,
    };
  },
  watch: {
    $route(to) {
      console.log(to);
      if (
        to.path == "/bookContent" ||
        to.path == "/bookHistory" ||
        to.name == "BookDetails"
      ) {
        this.isShow = false;
      } else {
        this.isShow = true;
      }
    },
  },
};
</script>
<style>
</style>
